1. Field of the Invention
The invention relates to apparatus for a spatial filter, specifically one that can function both recursively and non-recursively, for removing noise from video images and for preserving detail in those images, and to a method for use therein.
2. Description of the Prior Art
Currently, systems that digitally process an analog video image are becoming increasingly common. These systems illustratively include facsimile systems, systems for scanning paper documents and/or microfilm into machine readable form, and electronic reproduction, e.g. xerographic, systems. All these systems accept an analog image, typically an image appearing on, for example, a piece of paper and then transform that image into a so-called frame of digital information. Thereafter, the frame is digitally processed, often to remove extraneous noise and/or to perform rudimentary image enhancement. The results of this processing may be converted back into analog form for eventual display at, for example, a remote facsimile receiver, or alternatively remain in digital form as input to a computer for further processing, such as to provide sophisticated image enhancement for locating fine pre-defined detail in the image.
A frame of digital video information used in these systems contains a matrix of small discrete picture elements, i.e. so-called pels or pixels. Each pel has a value assigned to it. For black and white (bi-level) images, often the value of each pel is binary "0" for black or binary "1" for white.
Unfortunately, whenever an image is scanned, noise frequently appears in the resulting frame. For bi-level images having a white background--typically that occurring in textual images, a pol in a scanned image might appear black when the same corresponding pel in the original image is white. This black pel is so called noise pel. Noise pels can result from various sources: from the scanning equipment itself or from the media that holds the original image. Specifically, the media that stores the original image may itself have certain characteristics that produce unwanted noise pels. For example, in microfilm systems that employ a very high reduction ratio, the size of each grain used in the microfilm itself is often comparable to the size of the detail in the image that is being recorded on that film. Hence, when light is projected through the microfilm, a grain on the film may cause an unwanted darkened area to appear in a projected image. This noise is often referred to as "film noise". If the grain is sufficiently large, film noise will cause a noise pel to appear in the scanned image. A similar phenomena, i.e. so-called "paper noise", occurs for images that exist on paper. Specifically, a sheet of paper often contains small surface irregularities. These irregularities reflect light differently and, as such, might cause spots to appear on an image that has been reflected from the paper into the scanner, or, in the case of reproduction system, onto a photo conductive drum or belt. These spots, in turn, cause noise pels to appear in the scanned image.
No matter how noise pels arise, they are unwanted and must be removed from a scanned image in order for it to accurately depict an original image.
One well-known technique for removing noise pels is to pass the entire image frame through a spatial filter. Generally speaking, spatial filters operate on a square array (matrix) of pels, typically 3 by 3 pels and larger, and produce a filtered value for the current pel which is located at the center of the array. The pels above the center pel are from the previous scan line; while those below the center pel from a portion of the following scan line. Two techniques have been taught in the art for removing noise pels: filtering the noise pels from the scanned image through use of high, low and/or band pass spatial filters--(the "filtering" technique), or detecting pre-defined patterns of pels in the array and setting the center pel in the array to a specific value in accordance with these patterns (the "logical smoothing" technique).
For example, in the filtering technique, a pre-defined weighting factor is assigned to each pel in the array. The values of all these factors determine the specific characteristics of the filter and are set to match a desired feature of interest in the image. In particular, the pel weightings can be chosen to implement a high pass spatial filter for extracting small scale fluctuations from the image--i.e. fine detail, and/or to implement a low pass spatial filter for detecting large scale fluctuations in the image--i.e. relatively large movements or brightness variations occurring over a relatively large area in the image. Once the value of all the weighting factors have been chosen, each pel in the array is multiplied by a corresponding factor. Thereafter, all the weighted pels in the array are summed together to generate the resulting pel. Noise pels can be removed by processing the array of pels through successive high and low pass spatial filters. U.S. Pat. No. 4,446,484 (issued to P. G. Powell on May 1, 1984) describes one such arrangement for a spatial filter which incorporates high, low and band pass spatial filters. Although arrangements such as this which rely on the filtering technique can generate satisfactory performance, the circuitry needed to implement any of these arrangements, for example that shown in the U.S. Pat. No. 4,446,484 tends to be quite complex.
To reduce circuit complexity and cost, various filters utilizing the above-described logical smoothing technique have been proposed. For example, see D. Ting et al "Digital Processing Techniques for Encoding of Graphics", Proceedings of the IEEE, Vol. 68, No. 7, July 1980, pages 757-769 (hereinafter referred to as "Ting"). Specifically, Ting teaches, on page 764, that a neighborhood, typically a 3 by 3 window of pels (also referred to as a pel mask), which surrounds a particular pel is defined and the value of the particular pel (the center or output pel) is determined by the presence or absence of a specific configuration of black or white pels in the window. Simple logical smoothing entails determining the value of the center pel in the window to be the "exclusive or" of the values of its eight neighboring pels. With this technique isolated black and white noise pels can be removed from an image. Hence, an isolated black pel can be selectively changed to white and vice versa where necessary to remove noise and enhance image quality. Logical smoothing is not only simpler to implement than the filtering technique described above but also possesses the additional advantage that the output pel is pre-defined for certain patterns of pels existing within the window. Unfortunately, simple logical smoothing produces rounded corners within the image that, for example, cause exaggerated serifs to appear on textual characters. A variation of logical smoothing is majority logic smoothing. Here, the value of a pel is determined by the value of a majority of pels around it. For example, a pel is set to black if more than half of its surrounding pels are black. Unfortunately, majority logic smoothing not only produces excessively smoothed characters but also tends to cause a loss of connectivity on thin lines present within the scanned image. To remedy this loss, an additional check is incorporated into majority logic smoothing and utilized before the center pel is set. This check entails storing additional patterns of pels. Each pattern resembles one possible thin contour of pels that can occur in the image. In this manner, the center pel is determined by majority logic smoothing except in those circumstances where a contour is detected and, in those instances, the contour dictates the color of the center pel. Unfortunately, in practice, majority logical smoothing with contour checking has produced images with thickened image detail. For example, see M. G. B. Ismail et al, "New Preprocessing Technique for Digital Facsimile Transmission" Electronics Letters, May 1980, Vol. 16, No. 10, pages 355-356.
The logical spatial filters thusfar described are non-recursive. For these filters, the color of an output pel only depends upon the original color of every pel existing within each pel mask. Specifically, regardless of whether the color of any pel was changed or not, only the original color of that pel, e.g. black, is used in the pel mask for the next successive output pel. Non-recursive filters generally posses a fairly "weak" filter characteristic and thus unfortunately do not completely remove noise pels from an image.
In an attempt to improve the performance of logical smoothing type spatial filters, the art has taught that these filters could be implemented as recursive. For a recursive filter, the color of an output pels. Specifically, if the upon values of previously changed pels. Specifically, if the color of a pel was changed from, for example, black to white, then the new color, white, of this pel is used in the pel mask for the next successive output pel. Recursive filters have a "strong" filtering characteristic and hence effectively remove noise pels from an image. Unfortunately, these filters disadvantageously remove fine detail from the image.
Therefore, a need exists in the art for a logical smoothing type spatial filter which can remove noise pels from a video image and, when necessary, also preserve fine detail.